package com.hzdesk.media.matvector.koreabatch.client.my_paperless.adapter;

import android.content.Context;
import android.util.Log;
import android.view.View;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.R;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.base.BaseAdapter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.base.BaseViewHolder;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.bean.DevicesCustomConfigurationBean;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.view_holder.FileSetConfigViewHolder;

/**
 * Created by Administrator on 2018/8/14.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class FileSetConfigAdapter<T>  extends BaseAdapter{
    public FileSetConfigAdapter(Context mContext) {
        super(mContext);
    }

    @Override
    protected int getItemLayout() {
        return R.layout.file_set_config_item;
    }

    @Override
    protected BaseViewHolder getItemViewHolder(View view) {
        return new FileSetConfigViewHolder(view);
    }

    @Override
    protected void onMyBindViewHolder(BaseViewHolder holder, int position) {
        FileSetConfigViewHolder fileSetConfigViewHolder = (FileSetConfigViewHolder) holder;
        if(mlist != null && mlist.size() >0){
            for (Object obj : mlist) {
                DevicesCustomConfigurationBean.DeviceMousesBean deviceMousesBean = (DevicesCustomConfigurationBean.DeviceMousesBean) obj;
                int mousseNum =  deviceMousesBean.getMouseNum();
                if(mousseNum == (position+1)){
                    fileSetConfigViewHolder.getTv_desc().setText("已配置");
                }
            }
        }
        fileSetConfigViewHolder.getTv_mouseset().setText((position+1)+"号鼠标");
    }

    @Override
    public int getItemCount() {
        return 8;
    }
}
